package com.example.ywr.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 商品分类实体类
 */
@Data
@Entity
@Table(name = "category")
@EqualsAndHashCode(callSuper = true)
public class Category extends BaseEntity {

    /**
     * 分类名称
     */
    @Column(name = "name", nullable = false)
    private String name;

    /**
     * 分类描述
     */
    @Column(name = "description")
    private String description;

    /**
     * 父分类ID
     */
    @Column(name = "parent_id")
    private Long parentId;

    /**
     * 分类层级
     */
    @Column(name = "level", nullable = false)
    private Integer level = 1;

    /**
     * 排序
     */
    @Column(name = "sort")
    private Integer sort = 0;

    /**
     * 分类状态：0-禁用，1-启用
     */
    @Column(name = "status", nullable = false)
    private Integer status = 1;
}